<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button id="btn">click</button>
</body>
<script src="https://lib.baomitu.com/jquery/3.5.1/jquery.js"></script>
<script src="http://mockjs.com/dist/mock.js"></script>
<script src="./mock.js"></script>
<script>
    $("#btn").click(function(){
        $.ajax({
            type: "post",
            url: "http://www.test.com",
            data: "data",
            success: function (res) {
                console.log(JSON.parse(res));
            }
        });
    })


    // let str = 'abcdcdefffg'
    // let arr = str.split('')
    // var temp = []
    // var temp1 = []
    // console.log(arr);
    // arr.map((item,index)=>{
    //     let k = temp.indexOf(item)
    //     if(k==-1){
    //        temp.push(item)
    //        temp1.push(1)

    //     }else{
    //         temp1[k]++
    //     }

    // })
    // console.log(temp1);
    // console.log(temp);
    // let newTemp1 = [].concat(temp1) //把一开始的temp1存一分，因为sort会排序改变原数组
    // let endNum = temp1.sort().pop() //最大数值
    // console.log(endNum);
    // console.log(newTemp1);
    // let maxIndex = newTemp1.indexOf(endNum) 
    // console.log(temp[maxIndex],endNum);

</script>

</html>